package com.agileboot.attendance.domain.personnel.command;

import com.agileboot.common.annotation.ExcelColumn;
import com.agileboot.common.annotation.ExcelSheet;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

/**
 * <p>
 * 添加人员命令
 * </p>
 *
 * @author agileboot
 * @since 2023-03-14
 */
@Data
@ApiModel(value = "添加人员命令")
@ExcelSheet(name = "人员数据")
public class AddPersonnelCommand {

    @ApiModelProperty("人员姓名")
    @NotBlank(message = "人员姓名不能为空")
    @Size(max = 50, message = "人员姓名长度不能超过50个字符")
    @ExcelColumn(name = "人员姓名")
    private String personnelName;

    @ApiModelProperty("人员编码")
    @NotBlank(message = "人员编码不能为空")
    @Size(max = 50, message = "人员编码长度不能超过50个字符")
    @Pattern(regexp = "^[A-Za-z0-9]+$", message = "人员编码只能包含字母和数字")
    @ExcelColumn(name = "人员编码")
    private String personnelCode;

    @ApiModelProperty("身份证号")
    @Length(max = 18, message = "身份证号长度不能超过18个字符")
    @ExcelColumn(name = "身份证号")
    private String idNumber;

    @ApiModelProperty("所属供应商ID")
    @NotNull(message = "所属供应商不能为空")
    @ExcelColumn(name = "供应商ID")
    private Long supplierId;

    @ApiModelProperty("性别（0男 1女 2未知）")
    @ExcelColumn(name = "性别")
    private String gender = "2";

    @ApiModelProperty("出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ExcelColumn(name = "出生日期")
    private Date birthDate;

    @ApiModelProperty("手机号码")
    @Pattern(regexp = "^1[3456789]\\d{9}$", message = "手机号码格式不正确")
    @ExcelColumn(name = "手机号码")
    private String phoneNumber;

    @ApiModelProperty("邮箱")
    @Email(message = "邮箱格式不正确")
    @Size(max = 100, message = "邮箱长度不能超过100个字符")
    @ExcelColumn(name = "邮箱")
    private String email;

    @ApiModelProperty("级别（01初级 02中级 03高级 04专家）")
    @NotBlank(message = "级别不能为空")
    @ExcelColumn(name = "级别")
    private String level;

    @ApiModelProperty("人月单价")
    @NotNull(message = "人月单价不能为空")
    @ExcelColumn(name = "人月单价")
    private BigDecimal monthlyRate;

    @ApiModelProperty("入场日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ExcelColumn(name = "入场日期")
    private Date entryDate;

    @ApiModelProperty("离场日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ExcelColumn(name = "离场日期")
    private Date leaveDate;

    @ApiModelProperty("状态（0在岗 1离场 2休假）")
    @ExcelColumn(name = "状态")
    private String status = "0";

    @ApiModelProperty("关联用户ID")
    @ExcelColumn(name = "关联用户ID")
    private Long userId;

    @ApiModelProperty("备注")
    @Size(max = 500, message = "备注长度不能超过500个字符")
    @ExcelColumn(name = "备注")
    private String remark;
} 